package com.yingside.io.io;

import java.io.*;

public class TestOutputTrue {
    public static void main(String[] args) {
       /* FileOutputStream fos = null;
        BufferedOutputStream bos = null;
        try {
            fos = new FileOutputStream("images/TestJFram.txt",true);

            bos = new BufferedOutputStream(fos);
            bos.write((int)'a');
            bos.write((int)'b');
            bos.write((int)'c');
            bos.write((int)'d');
            bos.write((int)'e');

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                bos.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }*/

        /*FileWriter writer = null;
        BufferedWriter bw = null;
        try {
            writer = new FileWriter("images/TestJFram.txt",true);
            bw = new BufferedWriter(writer);

            bw.write("哈哈哈哈");

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                bw.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }*/

        //PrintWriter 构造器后面的boolean参数表示是否每次读写完数据之后需要冲刷管道
        PrintWriter out = null;
        try {
            out = new PrintWriter(new FileOutputStream("images/TestJFram.txt"),true);
            out.println("哦哦哦");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            out.close();
        }


    }
}
